/*
 * Audio.java
 *
 * Created on 25 mai 2007, 02:01
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package devintgame;

import t2s.SIVOXDevint;

/**
 *
 * @author gaby
 */
public class Audio {
    
    private static final String ressources = StaticFields.ressourcePath;
    
    SIVOXDevint voix;
    /** Creates a new instance of Audio */
    public Audio() {
        voix = new SIVOXDevint();
    }
    
    public void playWav (String name){
        voix.stop();
        voix.playWav(ressources+name);
    }
    public void playWav (String name, int wait){
        playWav (name);
        temporisation (wait);
    }
    
    public void playText (String text){
        voix.stop();
        voix.playText(text);
    }
    
    public void playText (String text, int wait){
        playText (text);
        temporisation (wait);
    }
    public void stop(){
        voix.stop();
    }
    
    private void temporisation(long temps){
		try {Thread.sleep(temps);}
		catch(InterruptedException e){}
	}	// Fin de temporisation
    
}
